// Project name:JavaRedis
// Creator:muhong
// Date time:2023/7/24,11:53 上午
// Name:DefaultSelectStrategy

package org.gmh.channel;


import org.gmh.util.IntSupplier;

public class DefaultSelectStrategy implements SelectStrategy {

    static final SelectStrategy INSTANCE = new DefaultSelectStrategy();

    private DefaultSelectStrategy() {
    }

    @Override
    public int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws Exception {
        return hasTasks ? selectSupplier.get() : SelectStrategy.SELECT;
    }
}
